package com.example.chapter04.controller;

import com.example.chapter04.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Arrays;

@Controller
public class LoginController {

    @GetMapping("/toLoginPage")
        public String index(Model model){
            Student student = new Student();
            student.setId(123);
            student.setName("罗翔");
            student.setSex(0);
            student.setHobby(Arrays.asList("sleep","play","football"));
            model.addAttribute("student",student);
            model.addAttribute("message","传递的内容");
            return "index";
    }
}
